UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G/fxTBnExTO3Q49A5zrE0OKhtHtJ5xqhX10IXhY1XMo='
WHERE
key_id = '7fb9f77c3dbefac516c9488794a27087af80c7e41a9db12d7888e4f411932d3e'
AND (
token = 'G/fxTBnExTO3Q49A5zrE0OKhtHtJ5xqhX10IXhY1XMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)