UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3n/I7L3Kkk+zlogQfKssGlKjnn17k1YpN8IRxR76nXk='
WHERE
key_id = '87fb3fc20b13cef85ee47b9d7543f9fedcbafe7bf28805c309ea8e0a8c77c2e2'
AND (
token = '3n/I7L3Kkk+zlogQfKssGlKjnn17k1YpN8IRxR76nXk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)