UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2BhrLDxuJ/7lT+rIT99mjaa6FW1+cTA+Ff5odIIxq08='
WHERE
key_id = '4f236fe7527116323c3f3d363743fb7cdd1f3f8e95e2e623c179f7fe5622f6b0'
AND (
token = '2BhrLDxuJ/7lT+rIT99mjaa6FW1+cTA+Ff5odIIxq08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)