UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Q/aIU25VIw+xqcjAAolJl+AsJAPpbQPUXiMIDOZUgE=' 
WHERE 
  key_id = '3fbadf0ddfa5203270de30cdcc827992249ea6d6b0a1410aa51fdff822f1ba4e' 
  AND (
    token = '5Q/aIU25VIw+xqcjAAolJl+AsJAPpbQPUXiMIDOZUgE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033