UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SXXlEsM+i/M2PjY+86kvvIEoBVeKpOCnWs4cd6JcjQM='
WHERE
key_id = 'a14f5414d9e80af9a3987c21c36d29625ac1892736d7609b7c30f2ab5e0a42bb'
AND (
token = 'SXXlEsM+i/M2PjY+86kvvIEoBVeKpOCnWs4cd6JcjQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)