UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rAzkdfCmVcT2TahgoEGuzE578cSHKGJpja0r/9PUa3I='
WHERE
key_id = '90690917bbbc1bb564f51cf657bf437a9967703185b24fe0f814efed92140784'
AND (
token = 'rAzkdfCmVcT2TahgoEGuzE578cSHKGJpja0r/9PUa3I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)