UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gfDiuRhaDDZslhGiLyS5m4gdFYLwsOrxOyKBlvJNhNQ='
WHERE
key_id = '37fa84efb6fdd8fc15d02b8b26ae8b6316906ceb97313d202e1b4dfdce2d5321'
AND (
token = 'gfDiuRhaDDZslhGiLyS5m4gdFYLwsOrxOyKBlvJNhNQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)