UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2TRfVuB9tAm3CCURmNvBLV3/52PaCxBmIGpCm/2onpw=' 
WHERE 
  key_id = 'ee66cce9fd67f84bdc11282bcfe815265daaff2175a798a0e0de92320186a809' 
  AND (
    token = '2TRfVuB9tAm3CCURmNvBLV3/52PaCxBmIGpCm/2onpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019