UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HtSipwFmuDB3rWl8vxz6XFXBJR7HRYvWNuGh/JJ8hL4='
WHERE
key_id = 'bbe34751b28bc187a73a812a532a07df02b23d85fa629fa1e123d70702d9e488'
AND (
token = 'HtSipwFmuDB3rWl8vxz6XFXBJR7HRYvWNuGh/JJ8hL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)