UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ojb+ycTIPaYHJDkwZaaDjOlL+M+AmquYyU9ZtJdiwJk='
WHERE
key_id = 'f1f5a06d4122e3f28d280059e834f88a6123c0933ec23754951d156eb63f5cf0'
AND (
token = 'ojb+ycTIPaYHJDkwZaaDjOlL+M+AmquYyU9ZtJdiwJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)