UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R+KBSUz/jJCUgKsfm9pkUa1cLfTHRmm1/jT1/TNIYdg='
WHERE
key_id = '56de66c716c4c19f943179f08d47dd5d0d51db7c70793f5fd3f1bf9767b80322'
AND (
token = 'R+KBSUz/jJCUgKsfm9pkUa1cLfTHRmm1/jT1/TNIYdg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)