UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RqTcI7VDa+HwyDxjx1wdJOTMZ/ig4tovMqqfkQsTCQM=' 
WHERE 
  key_id = '278657c672d5a23c74f8fe1f6a4f21c08dc2cb2d3e69b16850d5b6485a678a36' 
  AND (
    token = 'RqTcI7VDa+HwyDxjx1wdJOTMZ/ig4tovMqqfkQsTCQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037