UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eRbrs6NhgyBBbDUSvmxdj6U6rg9AFOUi0Pbz7eF4Fwk='
WHERE
key_id = '062ffaccb16d1898181d29ff62727f38d0d5f437b3c03c6665a39fbbe8adb8ec'
AND (
token = 'eRbrs6NhgyBBbDUSvmxdj6U6rg9AFOUi0Pbz7eF4Fwk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)