UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cNeeqyo5UJmwPNhJVNjk2Btzkmg2oD5m/p2epPs428I=' 
WHERE 
  key_id = '7cbb6fb3121722d584239d1b9515d2781663e9f07b8d9dd9e694161c59274fff' 
  AND (
    token = 'cNeeqyo5UJmwPNhJVNjk2Btzkmg2oD5m/p2epPs428I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017