UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'INt/lt1zCKyhSV15TsvtlUA5lpUjJjSvOCsWlyR3Tpc=' 
WHERE 
  key_id = '0ac2f6c41122f42287624d680a6fc7a6f9b4ca43f30a0d0e489541e538e2bcd7' 
  AND (
    token = 'INt/lt1zCKyhSV15TsvtlUA5lpUjJjSvOCsWlyR3Tpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031