UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ANFMpBXozY0h3tvE6a/rvmic0jJLf0rDlVP+wjfxfFM=' 
WHERE 
  key_id = 'cdd604e45c6fda41ff7525924719af81a213eaa3ca1904cb2a50f04042e7017f' 
  AND (
    token = 'ANFMpBXozY0h3tvE6a/rvmic0jJLf0rDlVP+wjfxfFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032