UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7K68jQM0VYo+0MTzNbbCv0e6RGwXhCFox0IdlKtYEJM='
WHERE
key_id = 'f7f32a5f5c0c0b6860562cf8edf3149a926e2c8dacc952a1aa53b0f601ff0771'
AND (
token = '7K68jQM0VYo+0MTzNbbCv0e6RGwXhCFox0IdlKtYEJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)