UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+PXQJzGR5lSg/gbHYdctIUnh+vL/ud0XC6qkKSh6aLs='
WHERE
key_id = 'fc891bf3a9a8420342ab2f61ab9f78eab4fba903dda1500088a6e5e12a0cefda'
AND (
token = '+PXQJzGR5lSg/gbHYdctIUnh+vL/ud0XC6qkKSh6aLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)