UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nzA07jnM8WT48KfUumz7kMN8kasgNceUxI4dmEhVlZU='
WHERE
key_id = '7654112e1af4b34682180cfe9eeaf105e1c418a9aa3a9ddd1fb31ea6887b4159'
AND (
token = 'nzA07jnM8WT48KfUumz7kMN8kasgNceUxI4dmEhVlZU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)