UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '00p2noU+mnB5EN06PJL/sHxeTJmPQ197DbmUOOSuC7w=' 
WHERE 
  key_id = '0053b2da90a5d32e58078038a85e8f43c985c8d02ff3b1d786bcef033f31c246' 
  AND (
    token = '00p2noU+mnB5EN06PJL/sHxeTJmPQ197DbmUOOSuC7w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037