UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8A30S/p/vf5kUT3AiMZRixVvZdFysAEXyc+5t4KCBAk='
WHERE
key_id = 'b70aac45fa639a7c78c146fcb105b3628d2544b640d8acb2a1823e710e1d9ad8'
AND (
token = '8A30S/p/vf5kUT3AiMZRixVvZdFysAEXyc+5t4KCBAk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)