UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4YHPNarGggA8pzAExkxCWOlmwZDUYiV8t67WsYDyJQ4='
WHERE
key_id = 'cac4f1b6261ea108c54ea2df1115d922891a73f89c3b20500b9075a44ec1c041'
AND (
token = '4YHPNarGggA8pzAExkxCWOlmwZDUYiV8t67WsYDyJQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)