UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WQDeyhJZWJ29xrm/khJliUg8lxMVqyu5xhwmvv7RYdU='
WHERE
key_id = '62bab73aa4dd87cc62d3f5cb33e641211e3357748c232d8c0918a68817add480'
AND (
token = 'WQDeyhJZWJ29xrm/khJliUg8lxMVqyu5xhwmvv7RYdU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)