UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jP/J8/abSWHdtpkr5jNYAUp90Bm4yXbF2nHIW6bnoIg=' 
WHERE 
  key_id = 'c6f56c7f86a7f12efbe11a28937848fecd1d07777f110b6c289a4e297862a8f3' 
  AND (
    token = 'jP/J8/abSWHdtpkr5jNYAUp90Bm4yXbF2nHIW6bnoIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043