UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GFX0oYtVt0AqtE47Ka8Lnf1Te9SERvSI0/uPPnD63FQ='
WHERE
key_id = 'cbd18b39d7bfcfb70397cf5f3e45c731addfe3418a61b091e057cbb98c93ca51'
AND (
token = 'GFX0oYtVt0AqtE47Ka8Lnf1Te9SERvSI0/uPPnD63FQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)