UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YnzIJhihRCSEKZaKE++0Tc/uZCxQX8YnAbDkLPtC40U='
WHERE
key_id = '6dbacd5885ce6b13cba392ed35e3d4dbedc9cfe711d7691d4963f6074400e563'
AND (
token = 'YnzIJhihRCSEKZaKE++0Tc/uZCxQX8YnAbDkLPtC40U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)