UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3rcUPJFPnpB8LLUxVhj621hKMjokhqW2GMzhPYxKw2k=' 
WHERE 
  key_id = 'cdbbc885f4acc9992afe63f4b0d4bce318e6a0a99d7726f444671b5c308e2ff9' 
  AND (
    token = '3rcUPJFPnpB8LLUxVhj621hKMjokhqW2GMzhPYxKw2k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023