UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ITUmwEb9TmrJJcM0uZmQgSKfuZkLirs1n7FE/vdH7g='
WHERE
key_id = '6c872fa01cf67793ee3363f1bce35aadd08318e41450acbc9ccc06f3dae25def'
AND (
token = '7ITUmwEb9TmrJJcM0uZmQgSKfuZkLirs1n7FE/vdH7g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)