UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GSkBBFCGG4ukZwDVADTwAwafh/Hcwroky8knfMW3Gt8='
WHERE
key_id = '36c1b21052363358e0baa45a3f5a6619bb090fcb5b5efe037d36abef7ac4796c'
AND (
token = 'GSkBBFCGG4ukZwDVADTwAwafh/Hcwroky8knfMW3Gt8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)