UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ysBqZuXusmcc5SUJzcT8aiG1fQF+0WOrfni5QYz6o94='
WHERE
key_id = '1abdbca0cdf460fa784c9f1145a9214c66cbe861f7c1e5a8bfb82be0efe29861'
AND (
token = 'ysBqZuXusmcc5SUJzcT8aiG1fQF+0WOrfni5QYz6o94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)