UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZhR9fvttKu+0AjC1gCYbewYM9gR94SXj/kHjPyi6egg='
WHERE
key_id = '41ae9b03b12e81245b4b4087383e0ce28b057f7a1fa451cd102f297f5ecd766b'
AND (
token = 'ZhR9fvttKu+0AjC1gCYbewYM9gR94SXj/kHjPyi6egg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)