UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ERWKt3j+FvLpN8La+/A2CfX70RNqtuv3GeUWkyYC5o='
WHERE
key_id = 'd01bae44dbffcf4f79c6cfb458973f7ca5af6b3084671828c041a0b870691e2b'
AND (
token = '7ERWKt3j+FvLpN8La+/A2CfX70RNqtuv3GeUWkyYC5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)