UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vWpsIOMqo6wiRgR/tLatn4UfeVN5OksHRUouCiHWpy0=' 
WHERE 
  key_id = '3320e42aa021e749a5bad506cc411c507acf682c0b9d9959c0c636b68823d157' 
  AND (
    token = 'vWpsIOMqo6wiRgR/tLatn4UfeVN5OksHRUouCiHWpy0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023