UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2eDxpY1XvhpH3WKn3ppS58I5onYz/f0hm3CZsv2SeG4=' 
WHERE 
  key_id = '279a1e899ca23f08513ce606099b9497f015cfc58e1afe234fd8997fb7f47dc8' 
  AND (
    token = '2eDxpY1XvhpH3WKn3ppS58I5onYz/f0hm3CZsv2SeG4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050