UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6W8jwND1AeSkQYdFEtcgHj1yQ6SvrISo49trJzkNsbo=' 
WHERE 
  key_id = '9ef682d9cc25c6b5a5c983d811fbcd28a985b377342a7b9b850669de20465dfa' 
  AND (
    token = '6W8jwND1AeSkQYdFEtcgHj1yQ6SvrISo49trJzkNsbo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024