UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZPnfyo2GlqCfGR6bMKukCGneQLxqP7LvsOrvjL9OwTg='
WHERE
key_id = '125bf4d37ea16869640904bf30d0e7e4638ea924dfd3857cc8f99ea9d3f0e592'
AND (
token = 'ZPnfyo2GlqCfGR6bMKukCGneQLxqP7LvsOrvjL9OwTg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)