UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G+dCEa+mLy/aVj/h/H3XzpyFGxQ1L2mKWDAJAUdK+8A='
WHERE
key_id = 'd4c4f40f6d7ad51bbf16a6b275824581eed63ec647066e3150bc1a4af26f4576'
AND (
token = 'G+dCEa+mLy/aVj/h/H3XzpyFGxQ1L2mKWDAJAUdK+8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)