UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ky4bEjOCpPPeuwi3F5hOr5cPYEItjCgGsBDEiP7D9Uc='
WHERE
key_id = '71d6bcc2d7aebcbc8c396fe3426ca18887a9b7aa1de4c05464476471fd642825'
AND (
token = 'ky4bEjOCpPPeuwi3F5hOr5cPYEItjCgGsBDEiP7D9Uc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)