UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CF/5xcF51FNuJfeldfMlwc0FOrFI8CLt/7vD6p9lzgU=' 
WHERE 
  key_id = '534ae28d931dbb453f5be8d601128d9705e79d22998cc8a5834aa893b7e394bd' 
  AND (
    token = 'CF/5xcF51FNuJfeldfMlwc0FOrFI8CLt/7vD6p9lzgU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044