UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o2Bb2JiQwZqMgdt13QQ9KzRoQwWonwYjuWNvzlQ0xp8=' 
WHERE 
  key_id = 'bd3d1bd584f9e9535346ba14ba7233f90242c73d1a2a539d5f8e52923b892f93' 
  AND (
    token = 'o2Bb2JiQwZqMgdt13QQ9KzRoQwWonwYjuWNvzlQ0xp8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024