UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I6NmW6wv0FTIZEvmEOftuC4HxvgmsP5OVBGPk7K3rp4='
WHERE
key_id = '4f32351be2f41580740e111d26ac59dfa2a84641aec638ade2c3b284665636bb'
AND (
token = 'I6NmW6wv0FTIZEvmEOftuC4HxvgmsP5OVBGPk7K3rp4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)