UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RMbJvWGm4Tt4GhQ/jg64y2Ku7jEHPwMgZorinnFl9Y8=' 
WHERE 
  key_id = '36e1b7ab508a74a5276f892d4cd01d508902918d35ed40896dade5e54d2123dd' 
  AND (
    token = 'RMbJvWGm4Tt4GhQ/jg64y2Ku7jEHPwMgZorinnFl9Y8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035