UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9RCpnaJy/64dTI/UPOEV1/C8qXxZw4I3M2wfDvtfMmE='
WHERE
key_id = '90229bcffe9e82fb9b9d602fe377975ecbd2c75a3568a136c1c77fc28dba07ce'
AND (
token = '9RCpnaJy/64dTI/UPOEV1/C8qXxZw4I3M2wfDvtfMmE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)