UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uqStmqac92pkGh/mjH0t9jixjJQqKtFo7iaY9OWyny4=' 
WHERE 
  key_id = 'a9bcd93c08dd9d06cf5a79bc30edc88d23ba5a22706e3429f98a028ebbbe87ef' 
  AND (
    token = 'uqStmqac92pkGh/mjH0t9jixjJQqKtFo7iaY9OWyny4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050