UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1lilUsvrLVBZUDfqN1n0uzDOH5eitVjFtnyIZXsAG1E='
WHERE
key_id = 'ad38d1b85ef9ed4ae442904426b762fc0571258acb71f5fc778867f93bf6b36e'
AND (
token = '1lilUsvrLVBZUDfqN1n0uzDOH5eitVjFtnyIZXsAG1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)