UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mM0+xmvIlB47vy0lD1Hw/MPfDkA0YHMy6w1Qx1lXNrw='
WHERE
key_id = '46a7a15accb350f9db25b52a13fa9d10fd9b51f9ed23eba8ba8ef7a6de111150'
AND (
token = 'mM0+xmvIlB47vy0lD1Hw/MPfDkA0YHMy6w1Qx1lXNrw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)