UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WinETvN0W9j4+oLVYHeFT7C7oU//6zNw/brFLmHCqPY='
WHERE
key_id = '6c7ad24bfdf5aa11a3687598cfe6898da20ab036978485c34a8c567963ac69eb'
AND (
token = 'WinETvN0W9j4+oLVYHeFT7C7oU//6zNw/brFLmHCqPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)