UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8AlxIDeS8b6eKnrLQt3xf9ndpo6J3V346N18Jyi0fk4=' 
WHERE 
  key_id = '86fd377c9a2cf88f6da464d561cad5ef5ef953c5ce7622beb6d23e9e7faba8f5' 
  AND (
    token = '8AlxIDeS8b6eKnrLQt3xf9ndpo6J3V346N18Jyi0fk4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030