UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UjIn2EAK45HIj/IerMDaAZ65su1smvKFQXXeYlILXyU='
WHERE
key_id = '2ba2bc31a445c27b0411f5863ea870a29d0774eda1485b42c425e96ec812c81d'
AND (
token = 'UjIn2EAK45HIj/IerMDaAZ65su1smvKFQXXeYlILXyU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)