UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CzXZYfGoukOCou9+Z8MNUeAzus7xtcLW05nHNvdi6AQ=' 
WHERE 
  key_id = '9ad20a891c604a6a5ad1f8b3cd790ef87d46d242f87f16d198664a609da9ae56' 
  AND (
    token = 'CzXZYfGoukOCou9+Z8MNUeAzus7xtcLW05nHNvdi6AQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036