UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WF8Z1c7MmHLPOTVSelpy14/3gffoAm/Lkt7CQSWZh+0=' 
WHERE 
  key_id = '3bd98a4056415c018b931fdfdeb08892f2fcd817281c0e4bbe9d54806d73e7ec' 
  AND (
    token = 'WF8Z1c7MmHLPOTVSelpy14/3gffoAm/Lkt7CQSWZh+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024