UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yOp/T1KgoJsyqQthhzaUO8mCrXsUJwFobil8wDFpoAM='
WHERE
key_id = '2aa86632a7d2ebd0a13852fa644c442fc2bda2188b30f87a40c09b096f50c724'
AND (
token = 'yOp/T1KgoJsyqQthhzaUO8mCrXsUJwFobil8wDFpoAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)