UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KN9cfrrC/Lf6TSM5A4qC6uBXvADPDnXETkR5I2mI5Ds=' 
WHERE 
  key_id = 'c60276d2584f0dcce67213147a3b9a24fd20c5356be79c37664d1d75f25e6520' 
  AND (
    token = 'KN9cfrrC/Lf6TSM5A4qC6uBXvADPDnXETkR5I2mI5Ds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035