UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3rjaO54T8DJ2jn6pprVohIB+w/JxGFn0QQdVgxHCdEU=' 
WHERE 
  key_id = 'eaa81f9988eb4711e1518ad8e557476e9fd8ea9fe3f87f116e6ea75a257ac5fe' 
  AND (
    token = '3rjaO54T8DJ2jn6pprVohIB+w/JxGFn0QQdVgxHCdEU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048