UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4ZKgwD50+R/OGKFGZoaJkblqVBQbpBne16zcS1aIKis=' 
WHERE 
  key_id = 'ce8b55a4f8d9825cda72c905fe677c7a82f1a61437bfa33a55b144d6141c4b88' 
  AND (
    token = '4ZKgwD50+R/OGKFGZoaJkblqVBQbpBne16zcS1aIKis=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033