UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o/HHkZBA224QtD41whTijr9n8fa7rRoR2X7z0/dixhs=' 
WHERE 
  key_id = '5dd1ef4bea23b8807fd4d6319d2a5d22f480566f3f7447698b03de7c9349ca25' 
  AND (
    token = 'o/HHkZBA224QtD41whTijr9n8fa7rRoR2X7z0/dixhs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050