UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dcSB8ZlOpoEIh5Q/si6z5ohCoJ4Jwfp/xDlYtAJtQJ4='
WHERE
key_id = '61ce537f46a51b662df02ff6cdc5f9898081e9fac3def348347a871f0b1bff5b'
AND (
token = 'dcSB8ZlOpoEIh5Q/si6z5ohCoJ4Jwfp/xDlYtAJtQJ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)